package com.hksj.Intelligentmanagement.auth.vo;

import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.List;

@Data
@ApiModel("权限信息")
public class MenuVo {

    @ApiModelProperty(value = "菜单id")
    private String id;

    @ApiModelProperty(value = "父级菜单id")
    private String pid;

    @ApiModelProperty(value = "菜单名")
    private String menuName;

    @ApiModelProperty(value = "类型 1 = 菜单  2 = 按钮 ")
    private Integer type;

    @ApiModelProperty(value = "路由地址")
    private String path;

    @ApiModelProperty(value = "组件路径")
    private String component;

    @ApiModelProperty(value = "权限标识")
    private String perms;

    @ApiModelProperty(value = "菜单图标")
    private String icon;

    @ApiModelProperty(value = "排序号")
    private Integer sortNo;

    @ApiModelProperty(value = "是否选中 0 = 否 ，2 = 是")
    private Integer selected;

    @ApiModelProperty(value = "菜单状态（0正常 1停用）")
    private String status;

    @ApiModelProperty(value = "子级菜单列表")
    private List<MenuVo> childList;

    @ApiModelProperty(value = "标题")
    private String title;

    @ApiModelProperty(value = "跳转路径")
    private String redirect;

    @ApiModelProperty(value = "菜单状态（0显示 1隐藏）")
    private String visible;

    @ApiModelProperty(value = "备注")
    private String remark;


    /**
     * 该字段只有用户登录权限树有
     */

    @ApiModelProperty(value = "菜单名 同 userName")
    private String name;

    @ApiModelProperty(value = "元数据")
    private MenuVo.Meta meta;

    @Data
    public class Meta{
        private String title;

        private Boolean isHide = false;

        private List<String> roles;

        private String icon;

    }

    @JsonIgnore
    public MenuVo.Meta getMetaInstance(){
        return new MenuVo.Meta();
    }

}
